import request from '@/utils/request'

// 查询供应商地址列表
export function listAddress(query) {
  return request({
    url: '/prod-api/supplier/address/list',
    method: 'get',
    params: query
  })
}

// 查询供应商地址详细
export function getAddress(supplierAddressUid) {
  return request({
    url: '/prod-api/supplier/address/' + supplierAddressUid,
    method: 'get'
  })
}

// 新增供应商地址
export function addAddress(data) {
  return request({
    url: '/prod-api/supplier/address',
    method: 'post',
    data: data
  })
}

// 修改供应商地址
export function updateAddress(data) {
  return request({
    url: '/prod-api/supplier/address',
    method: 'put',
    data: data
  })
}

// 删除供应商地址
export function delAddress(supplierAddressUid) {
  return request({
    url: '/prod-api/supplier/address/' + supplierAddressUid,
    method: 'delete'
  })
}

// 修改地址状态
export function updateDataStatus(supplierAddressUid, dataStatus,supplierUid){
  const data = {
    supplierAddressUid,
    dataStatus,
    supplierUid
  }
  return request({
    url: '/prod-api/supplier/address/updateDataStatus',
    method: 'put',
    data: data
  })
}

